package cn.itsource.feign.client;

import cn.itsource.doc.CourseDoc;
import cn.itsource.feign.fallback.CourseFeignClientFallback;
import cn.itsource.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "service-es", fallbackFactory = CourseFeignClientFallback.class)
public interface CourseFeignClient {

    //保存课程信息到ES中
    @PostMapping("/es/saveCourse")
    JSONResult saveCourse2Es(@RequestBody CourseDoc doc);

    //批量保存课程信息到ES中
    @PostMapping("/es/saveBatchCourse2Es")
    JSONResult saveBatchCourse2Es(@RequestBody List<CourseDoc> docList);
}